package com.jason.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.jason.bean.Role;

public interface RoleDao extends JpaRepository<Role, Integer> {
	@Query(value = "select r.* from user_role ur,role r where ur.role_id = r.id and ur.user_id=?", nativeQuery = true)
	public List<Role> findByUserId(Integer userId);
}
